/*
 * @Description  : 状态管理
 * @Autor        : 杜康
 * @Date         : 2023-03-07 15:07:13 +0800
 * @LastEditors  : 杜康
 * @LastEditTime : 2023-03-07 17:56:49 +0800
 */
import { ref, computed } from "vue";
import { defineStore } from "pinia";

export const useCounterStore = defineStore("counter", () => {
  const count = ref(0);
  const doubleCount = computed(() => count.value * 2);
  function increment() {
    count.value++;
  }

  return { count, doubleCount, increment };
});
